package net.dengzixu.java.homework.period25;

public class SalaryCalc {
    public static final double BASIC_SALARY = 80000;
    public static final double GROWTH_RATE = 0.06;
    public static final int YEARS = 10;

    public static void main(String[] args) {
        double total = 0;

        double lastYearSalary = BASIC_SALARY;


        for (int i = 0; i < YEARS; i++) {
            lastYearSalary *= 1 + GROWTH_RATE;

            total += lastYearSalary;
        }
        System.out.printf("未来 %d 年总收入为: %f", YEARS, total);
    }
}
